home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 4.7 KB | 165 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ValueStream.cpp
- // Release Version: $ 1.0d1 $
- //
- // Author: Anthone Burbidge
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef _VALUESTREAM_
- #include "ValueStream.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWSTDDEF_H
- #include <FWStdDef.h>
- #endif
-
- // ----- OpenDoc Inlcudes -----
-
- #ifndef _STORAGEU_
- #include "StorageU.h"
- #endif
-
- #pragma segment TextPartSegment
-
- //========================================================================================
- // CLASS CValueStream
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CValueStream::CValueStream
- //----------------------------------------------------------------------------------------
-
- CValueStream::CValueStream() :
- fSU(NULL)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::InitValueStream
- //----------------------------------------------------------------------------------------
-
- void CValueStream::InitValueStream(XMPStorageUnit *su)
- {
- CStream::IStream();
- fSU = su;
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::~CValueStream
- //----------------------------------------------------------------------------------------
-
- CValueStream::~CValueStream()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::WriteBytes
- //----------------------------------------------------------------------------------------
-
- OSErr CValueStream::WriteBytes(const void* theBytes, long bytesCount)
- {
- fSU->SetValue(bytesCount, (void *) theBytes);
- return noErr;
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::ReadBytes
- //----------------------------------------------------------------------------------------
-
- OSErr CValueStream::ReadBytes(void* theBytes, long bytesCount)
- {
- fSU->GetValue(bytesCount, theBytes);
- return noErr;
- }
-
-
- //----------------------------------------------------------------------------------------
- // CValueStream::GetPosition
- //----------------------------------------------------------------------------------------
-
- long CValueStream::GetPosition() const
- {
- return fSU->GetOffset();
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::SetPosition
- //----------------------------------------------------------------------------------------
-
- void CValueStream::SetPosition(long newPosition)
- {
- fSU->SetOffset(newPosition);
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::Skip
- //----------------------------------------------------------------------------------------
-
- void CValueStream::Skip(long count)
- {
- fSU->SetOffset(fSU->GetOffset() + count);
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::GetSize
- //----------------------------------------------------------------------------------------
-
- long CValueStream::GetSize() const
- {
- return fSU->GetSize();
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::Append
- //----------------------------------------------------------------------------------------
-
- OSErr CValueStream::Append(long count)
- {
- FW_UNUSED(count);
-
- DebugStr("\pCValueStream::Append(long count)");
-
- return noErr;
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::Empty
- //----------------------------------------------------------------------------------------
-
- void CValueStream::Empty()
- {
- fSU->DeleteValue(0);
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::Load
- //----------------------------------------------------------------------------------------
-
- OSErr CValueStream::Load(long size, Ptr* data)
- {
- FW_UNUSED(size);
- FW_UNUSED(data);
-
- DebugStr("\pCValueStream::Load(long size, Ptr* data)");
-
- return noErr;
- }
-
- //----------------------------------------------------------------------------------------
- // CValueStream::Unload
- //----------------------------------------------------------------------------------------
-
- void CValueStream::Unload(Ptr data)
- {
- FW_UNUSED(data);
-
- DebugStr("\pCValueStream::Unload(Ptr data)");
- }
-